package org.yournamehere.client;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;

public class MenuInicial extends Composite {

    /**
     * Create a remote service proxy to talk to the server-side Greeting
     * service.
     */
    //private final GreetingServiceAsync greetingService = GWT.create(GreetingService.class);
    public MenuInicial() {
        gui();
    }

    private void gui() {
        HorizontalPanel horizontalPanel = new HorizontalPanel();
        initWidget(horizontalPanel);

        Image image = new Image("imagenes/docentes.jpg");
        horizontalPanel.add(image);

        VerticalPanel verticalPanel = new VerticalPanel();
        horizontalPanel.add(verticalPanel);

        verticalPanel.setSpacing(50);

        Button btnPosiblesAsignaturasA = new Button(
                "Distributivo de Docentes");
        btnPosiblesAsignaturasA.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {
                RootPanel.get("titulo").clear();
                RootPanel.get("contenedor").clear();

                HTML titulo = new HTML("Distributivo de Docentes");
                RootPanel.get("titulo").add(titulo);


                RootPanel.get("contenedor").add(new getDataSparqlUsageExample());

            }
        });
        verticalPanel.add(btnPosiblesAsignaturasA);
        verticalPanel.setCellVerticalAlignment(btnPosiblesAsignaturasA,
                HasVerticalAlignment.ALIGN_MIDDLE);

        Button btnNewButton = new Button("D\u00EDas para seminarios");
        btnNewButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {
                RootPanel.get("titulo").clear();
                RootPanel.get("contenedor").clear();

                HTML titulo = new HTML("D\u00EDas para Seminarios");
                RootPanel.get("titulo").add(titulo);

                RootPanel.get("contenedor").add(new RQ2_DiasSeminarios());

            }
        });
        verticalPanel.add(btnNewButton);
        verticalPanel.setCellVerticalAlignment(btnNewButton,
                HasVerticalAlignment.ALIGN_MIDDLE);

        Button btnNewButton_1 = new Button("Déficit de Docentes");
        btnNewButton_1.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {
                RootPanel.get("titulo").clear();
                RootPanel.get("contenedor").clear();

                HTML titulo = new HTML("Déficit de Docentes");
                RootPanel.get("titulo").add(titulo);

                RootPanel.get("contenedor").add(new RQ3_AumentoDocentes());

            }
        });
        verticalPanel.add(btnNewButton_1);
        verticalPanel.setCellVerticalAlignment(btnNewButton_1,
                HasVerticalAlignment.ALIGN_MIDDLE);

    }
}
